home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.3 KB | 140 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ScrollEd.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SCROLLED_H
- #define SCROLLED_H
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- #ifndef FWEDVIEW_H
- #include "FWEdView.h"
- #endif
-
- #ifndef FWRECEVR_H
- #include "FWRecevr.h"
- #endif
-
- #if FW_PPOB_VIEWS
- #include "FWPPobOb.h"
- #endif
-
- #if FW_MACAPP_VIEWS
- #include "FWMAObjs.h"
- #endif
-
- //==============================================================================
- // Forward Declarations
- //==============================================================================
-
- class FW_CScrollBar;
- class FW_CNotification;
-
- //==============================================================================
- // class CScrollEdit
- //==============================================================================
- // CScrollEdit adds scrolling & undo functionalities to FW_CEditView.
- // See CScrollEdit's documentation at the top of the .cpp file
-
- class CScrollEdit : public FW_CEditView, public FW_MReceiver
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(CScrollEdit)
-
- // 1 step constructor
- CScrollEdit(Environment* ev,
- FW_CSuperView* container,
- const FW_CRect& bounds,
- ODID viewID,
- FW_CScrollBar* horzSB,
- FW_CScrollBar* vertSB,
- const FW_CString& text,
- const FW_CFont& font = FW_kNormalFont,
- short maxChars = FW_MAXINT16,
- unsigned short attributes = FW_CEditView::kDrawBox +
- FW_CEditView::kWordWrap +
- FW_CEditView::kAutoScroll,
- FW_Fixed textWidth = FW_kFixed0);
-
- // 2 steps constructor
- CScrollEdit(Environment* ev);
-
- virtual ~CScrollEdit();
-
- // ----- New API
- void UpdateScrollParameters(Environment* ev);
- void UpdateScrollUnits(Environment* ev);
- void AdjustTE(Environment* ev);
- void AdjustTERects(Environment* ev);
- void AdjustScrollbar(Environment* ev, FW_XYSelector direction);
- void Initialize(Environment* ev);
-
- // ----- Inherited API
- virtual FW_Handled DoAdjustMenus (Environment *ev, FW_CMenuBar* menuBar,
- FW_Boolean hasMenuFocus, FW_Boolean isRoot);
- virtual FW_Handled DoMenu (Environment* ev, const FW_CMenuEvent& event);
- virtual FW_Handled DoMouseDown (Environment* ev, const FW_CMouseEvent& event);
- virtual FW_Handled DoVirtualKey (Environment* ev, const FW_CVirtualKeyEvent & event);
- virtual FW_Handled DoCharKey (Environment* ev, const FW_CCharKeyEvent& event);
- virtual void HandleNotification(Environment* ev, const FW_CNotification& notification);
- virtual void SizeChanged (Environment* ev, const FW_CPoint& oldSize);
- virtual void SetText (Environment * ev, const FW_CString& str);
-
- // ----- Archiving -----
- #if FW_ODFRC_VIEWS
- static void* Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
- static void Destroy(void* object, FW_ClassTypeConstant type);
- virtual void Flatten(Environment* ev, FW_CWritableStream& stream) const;
- virtual void InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
- #endif
-
- private:
- FW_CScrollBar* fScrollbars[2]; // vert & horz scrollbars (may be NULL)
- FW_Fixed fWidth; // text width
- };
-
- //========================================================================================
- // class CPPobScrollEdit
- //========================================================================================
- #if FW_PPOB_VIEWS
-
- class CPPobScrollEdit : public FW_CPPobTextEdit
- {
- public:
- FW_DECLARE_AUTO(CPPobScrollEdit)
- CPPobScrollEdit(Environment* ev, FW_CReadableStream& stream, long type);
-
- static void* Create(Environment* ev, FW_CReadableStream& stream, long type);
- virtual void CreateODFView(Environment* ev);
- };
-
- #endif // FW_PPOB_VIEWS
-
- //========================================================================================
- // class CMAScrollEdit
- //========================================================================================
- #if FW_MACAPP_VIEWS
-
- class CMAScrollEdit : public FW_CMATEView
- {
- public:
- CMAScrollEdit(ResType type);
-
- static FW_CMAObject* Create(ResType type);
- virtual FW_CView* CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
- };
-
- #endif // FW_MACAPP_VIEWS
-
-
-
- #endif
-